Option Explicit

' 转换 Markdown Table 数据并写入当前的活动 sheet 中
Private Sub createToActiveSheetBtn_Click()
    Dim mdTableTxt As String
    mdTableTxt = Trim(mdTableInput.text)

    If mdTableTxt = "" Then
        MsgBox "please input markdown table"
        Exit Sub
    End If

    UtilMarkdown.transMdTableToActiveSheet mdTableTxt, _
        startCellName:= startCellInput.Value, _
        needEmptyRow:= needEmptyRowCheckBox.Value, _
        skipSecondSplitRow:=skipSecondSplitRowCheckbox.Value
End Sub

' 转换 Markdown Table 数据，然后创建一个新 sheet 并将转换结果写入新 sheet 中
Private Sub createToNewSheetBtn_Click()
    Dim mdTableTxt As String
    mdTableTxt = Trim(mdTableInput.text)

    If mdTableTxt = "" Then
        MsgBox "please input markdown table"
        Exit Sub
    End If

    Dim newSheetName As String
    newSheetName = Trim(newSheetNameInput.Value)
    If newSheetName = "" Then
        MsgBox "please input new sheet name"
    End If

    UtilMarkdown.transMdTableToNewSheet mdTableTxt, _
        startCellName:= startCellInput.Value, _
        needEmptyRow:= needEmptyRowCheckBox.Value, _
        skipSecondSplitRow:=skipSecondSplitRowCheckbox.Value, _
        newSheetName:= newSheetName
End Sub
